<?php

include('includes/dbConnection.php');

//mysql_query("INSERT INTO uyeler (KULLANICI_ADI,PAROLA,EMAIL,ISIM,sonSayfa,yer,KAYIT_TARIHI) VALUES('OnlineRusca','22426008','onlinerusca@gmail.com','Yonetim','anasayfa','Almanya',now())") or die(mysql_error());


$slideNum=12; //input
$presTitle="TestPresetation"; // input

$presId=1; // current presentation



//mysql_query("INSERT INTO presentations (slideNum,presTitle) VALUES('$slideNum','$presTitle')") or die(mysql_error());
//$sqlQuery=mysql_query("SELECT * FROM presentations") or die(mysql_error());

for($i=1;$i<=$slideNum;$i++){
$pageNumber=$i;
$caption='Caption of Slide '.$i;
$type=1;
$content="";
mysql_query("INSERT INTO slides (presId,pageNumber,caption,type,content) VALUES('$presId','$pageNumber','$caption','$type','$content')") or die(mysql_error());

}

$sqlQuery=mysql_query("SELECT * FROM presentations where presId=$presId") or die(mysql_error());
$rs=mysql_fetch_assoc($sqlQuery);

//while ($rs=mysql_fetch_assoc($sqlQuery)) {

                          $presId=$rs['presId'];
                          $presTitle= $rs['presTitle'];
			  $slideNum=$rs['slideNum'];
	echo $presId;
	echo $presTitle;
	echo $slideNum; 
//} //while

?>
